<script>
	import { useUserStore } from '@/stores/user.js'
	export default {
		onLaunch: function() {
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		onLoad:function(){
			this.getLoginCode()
		},
		methods:{
			getLoginCode(){
				const userStore = useUserStore()
				uni.login({
					provider: 'weixin', //使用微信登录
					onlyAuthorize: true,
					success: function (res) {
						userStore.loginCode = res.code
						console.log('code', userStore.loginCode)
					}
				})
			}
		}
	}
</script>

<style>
	/*每个页面公共css */
</style>
